package com.justnow.offer.times02;

/**
 * @author justnow
 * Created on 2020-10-06
 * Description
 *
 * 三个线程顺序执行
 */
public class Demo01 {
    public static void main(String[] args) {
        Thread thread01 = new Thread(()-> {
            System.out.println("thread01");
        });
        Thread thread02 = new Thread(()-> {
            try {
                thread01.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("thread02");
        });
        Thread thread03 = new Thread(()-> {
            try {
                thread02.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("thread03");
        });
        thread01.start();
        thread02.start();
        thread03.start();
    }
}
